package com.shujia.function;

import org.apache.flink.table.functions.ScalarFunction;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateFunction extends ScalarFunction {
    public String eval(String d) {

        Date date = new Date(d);

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH");

        return dateFormat.format(date);

    }
}